<!DOCTYPE html>
<html lang="en">
<head>
    {% load static %}
    {% load cache %}
    <meta charset="UTF-8">
    <title>{% block title %} 首页 {% endblock %} - 吒虎 博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes"/>
    <link rel="stylesheet" href="{% static 'css/bootstrap.css' %}">
    {% block extra_head %}{% endblock %}
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <div class="container">
        <a class="navbar-brand" href="/">首页</a>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto">
                {% for cate in navs %}
                <li class="nav-item">
                    <a class="nav-link" href="{% url 'blog:category-list' cate.id %}">{{ cate.name }}</a>
                </li>
                {% endfor %}

                <li class="nav-item">
                    <a class="nav-link" href="{% url 'blog:archive' %}">归档</a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="{% url 'blog:multi-search'%}">whoosh搜索</a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="{% url 'blog:show-images'%}">查看上传图片</a>
                </li>

                <li class="nav-item">
                    <a class="nav-link" href="{% url 'blog:file-list'%}">上传</a>
                </li>
            </ul>
            <form class="form-inline my-2 my-lg-0" action="{% url 'blog:search' %}" method="get">
                <input class="form-control mr-sm-2" type="search" name="keyword"
                       placeholder="Search" aria-label="Search" value="{{ keyword }}"/>
                <button class="btn btn-primary" type="submit">搜索</button>
            </form>
        </div>
    </div>
</nav>
<hr/>
<div class="container main">
    <div class="row">
        <div class="col-10 post-list">
            {% block main %}
            {% endblock %}
        </div>
        <div class="col-2">
            {% include 'blog/right.html' %}
        </div>
    </div>
</div>

<footer class="footer">
    {% block footer %}
    <div class="container">
        <hr/>
        <nav class="nav category">
            {% for cate in categories %}
            <a href="{% url 'blog:category-list' cate.id %}" class="nav-link">{{ cate.name }}</a>
            {% endfor %}
        </nav>
    </div>
    <div class="container">
        <hr/>
        <span class="text-muted">Power by 吒虎</span>
    </div>
    {% endblock %}
</footer>

</body>
</html>